package lexer;

/**
 * represents a token of code containing informaion about its position in the file and it's type
 * as well as an errormessage for debugging purposes
 * 
 * @author Caroline
 *
 */

public class Token {
	
	TokenType type;
	String contents;
	int fileLine;
	int fileCol;
	String errorMessage;
	
	public Token (TokenType type, int fileLine, int fileCol) {
		this.type = type;
		this.fileLine = fileLine;
		this.fileCol = fileCol;
	}
	
	public Token (TokenType type, int fileLine, int fileCol, String contents) {
		this(type, fileLine, fileCol);
		this.contents = contents;
	}

	public int getFileLine() {
		return fileLine;
	}

	public TokenType getType() {
		return type;
	}

	public String getContents() {
		return contents;
	}

	public int getFileCol() {
		return fileCol;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}
	
}
